package work.zhengyun.demo.model.types;

public enum CashCouponStatusType {
    /**
     * 未付款1
     */
    UN_PAY(1,"未付款"),
    /**
     * 发行2
     */
    PUBLISH(2,"发行"),
    /**
     * 已领完3
     */
    PULL_OVER(3,"已领完"),
    /**
     * 停止发放4
     */
    PULL_STOP(4,"停止发放");

    private CashCouponStatusType(Integer type, String typeName){
        this.type = type;
        this.typeName=typeName;
    }

    public static boolean checkExists(Integer type){
        if(null==type){
            return false;
        }
        CashCouponStatusType enums[] =CashCouponStatusType.values();
        for (int i = 0; i < enums.length; i++) {
            CashCouponStatusType singleEnum=  enums[i];
            if(singleEnum.getType().equals(type)){
                return true;
            }
        }
        return false;
    }

    private Integer type;
    private String typeName;
    public Integer getType() {
        return type;
    }
    public String getTypeName() {
        return typeName;
    }
}
